#include "ModbusServer.h"
ModbusServer::ModbusServer(/* args */)
{
}

ModbusServer::~ModbusServer()
{
}
void ModbusServer::addPort(ArduinoRS485 *p)
{
    s = new ModbusRTUServer();
    s.begin(p);
    servers.push(s);
}
void ModbusServer::setCoil(int index, bool value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setCoil(index, value);
    }
}
void ModbusServer::setHold(short index, u16_t value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setHold(index, value);
    }
}
void ModbusServer::setDisret(u16 index, bool value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setDisret(index, value);
    }
}
void ModbusServer::setInput(u16 index, u16_t value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setInput(index, value);
    }
}
bool ModbusServer::getCoil(u16 index) {}
u16 ModbusServer::getHold(u16 index) {}
void ModbusServer::setInput32(u16 index, int value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setInput(index, value);
    }
}
int ModbusServer::getInput32(u16 index, int value);
void ModbusServer::setInputFloat(u16 index, float value)
{
    for (int i = 0; i < servers.size(); i++)
    {
        ModbusRTUServer *s = servers[i];
        i.setInput(index, value);
    }
}
float ModbusServer::getInputFloat(u16 index) {}